2023-07-10

Using .desktop Files for Bookmarks

Trying to use bookmarks in browsers to go to commonly visited sites is unfortunately a somewhat terrible experience. So long ago I switched to just doing that externally: Until now I just used a script that opened all these bookmarks in a menu (fuzzel, but any dmenu-like menu works for stuff like this). But as a fan of "do what I mean" features, it always annoyed me how this was yet another separate menu; Press Super+d for applications and Super+o for bookmarks. A bit primitive.

Having custom actions appear in application menus on linux is actually trivial. Just write a custom .desktop file and put it into ~/.local/share/applications/. Each bookmark in its own desktop file would be a bit excessive, but luckily the spec allows to have more than one action per .desktop file.

Here is an example:

[Desktop Entry]
Encoding=UTF-8
Name=bookmark
Comment=online bookmarks
Exec=firefox
Terminal=false
Type=Application
Icon=firefox
Actions=my-site;sourcehut;

[Desktop Action my-site]
Name=My Website
Exec=firefox https://leon_plickat.srht.site

[Desktop Action sourcehut]
Name=sourcehut
Exec=firefox "https://git.sr.ht/"

Now I can open sourcehut inside firefox comfortably from my application menu. No longer do I first have to waste a thought on whether the thing I want to open is an application or a website (and honestly some things are simply both). Nice.

This obviously also works with local files. There are a few books I use often, so I created entries for them as well, this time using xdg-open as the opener.

Having to edit .desktop files to add bookmarks is not very convenient. However the ability to open commonly used webpages and files from my application launcher is worth it for me. I know the launchers of the big desktops do something similar out of the box, but mine doesn't and this is a fine workaround in the meantime. Also I was never particularly happy with how both gnomes launcher and krunner find important files anyway, so at least for me the actual UX of my .desktop file is a tiny bit better, since it gives me direct control over what does appear in the menu and what doesn't.

I do eventually want to have an application launcher menu that allows me to insert non-application entries programmatically, but for now this is enough.

Articles from blogs I read (generated by openring)

whippet lab notebook: guile, heuristics, and heap growth

Greets all! Another brief note today. I have gotten Guile working with one of the Nofl-based collectors, specifically the one that scans all edges conservatively (heap-conservative-mmc / heap-conservative-parallel-mmc). Hurrah!It was a pleasant surprise h…

wingolog, May 22, 2025

Status update, May 2025

Hi! Today wlroots 0.19.0 has finally been released! Among the newly supported protocols, color-management-v1 lays the first stone of HDR support (backend and renderer bits are still being reviewed) and ext-image-copy-capture-v1 enhances the previous screen ca…

emersion, May 15, 2025

Summary of changes for April 2025

Hey everyone!This is the list of all the changes we've done to our projects during the month of April. 100r.co, updated water, ditch bag, woodstove installation, and added new photos and information on first-aid kit. Rabbit Waves, updated Triangular…

Hundred Rabbits, April 30, 2025